package xin.marcher.module.construction.converter;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import xin.marcher.module.construction.domain.entity.AttributeKeyDO;
import xin.marcher.module.construction.domain.entity.AttributeValueDO;
import xin.marcher.module.construction.domain.request.AttributeRequest;

import java.util.List;

/**
 * 品类相关对象克隆
 *
 * 
 */
@Mapper(componentModel = "spring")
public interface AttributeConverter {

    /**
     * 对象克隆
     *
     * @param attributeKeyRequest
     * @param operateUser
     * @return xin.marcher.module.construction.domain.entity.AttributeKeyDO
     */
    @Mapping(target = "updateUser", source = "operateUser")
    AttributeKeyDO converterKeyDO(AttributeRequest.AttributeKeyRequest attributeKeyRequest, Integer operateUser);

    /**
     * 对象克隆
     *
     * @param attributeValueRequest
     * @param operateUser
     */
    @Mapping(target = "updateUser", source = "operateUser")
    AttributeKeyDO converterValueDO(AttributeRequest.AttributeValueRequest attributeValueRequest, Integer operateUser);

    /**
     * 对象克隆
     *
     * @param attributeValueRequests
     */
    List<AttributeValueDO> converterValueDOList(List<AttributeRequest.AttributeValueRequest> attributeValueRequests);
}
